# Contributor: Sean McAvoy <seanmcavoy@gmail.com>
# Maintainer: Sean McAvoy <seanmcavoy@gmail.com>
pkgname=topgrade
pkgver=9.0.1
pkgrel=0
pkgdesc="run upgrades of packages in OS and other package managers"
url="https://github.com/r-darwish/topgrade"
arch="all !s390x !riscv64"
license="GPL-3.0-or-later"
makedepends="rust cargo"
subpackages="$pkgname-doc"
source="topgrade-$pkgver.tar.gz::https://github.com/r-darwish/topgrade/archive/refs/tags/v$pkgver.tar.gz"

build() {
	cargo build --release
}

check() {
	cargo test
}

package() {
	install -Dm755 target/release/topgrade "$pkgdir"/usr/bin/topgrade
	install -Dm644 topgrade.8 "$pkgdir"/usr/share/man/man8/topgrade.8
	install -Dm644 config.example.toml "$pkgdir"/usr/share/doc/topgrade/config.example.toml
	install -Dm644 LICENSE "$pkgdir"/usr/share/license/topgrade/LICENSE
}

sha512sums="
d62b7c9c034f0bd836f59cf05fac634b509358a2a548f67001d826788c6c5649d7d3a0b7d8e7103c6c98e0bdbbd7ce564258464c93b3c0f595e5c8212e8d5216  topgrade-9.0.1.tar.gz
"
